Scheduler for WinRT > Features > Reminders > Toast Notifications |
Using toast notification instead of the built-in reminder dialog allows users to get notifications whether or not the application is running. This also allows an end-user to launch the application by clicking on the notification. You can see a full implementation of the toast notification property in the Save Local Data sample located in the ComponentOne Samples folder:
C:\Users\YourUserName\Documents\Documents\ComponentOne Samples\WinRT XAML Phone\C1.Xaml.Schedule\CS\ScheduleSamples
It's simple to set up toast notification, just use the following code in your MainPage() constructor. Note that it's contained within a try-catch statement:
C# |
Copy Code
|
---|---|
try { // set toast notifier for C1Schedule to show toast notifications instead of embedded reminder dialog sched1.ToastNotifier = Windows.UI.Notifications.ToastNotificationManager.CreateToastNotifier(); // note, notifications might not be shown if end-user disabled them for some reason // also, toast notifications are disabled when application is running in simulator } catch { // if application manifest doesn't allow toast notifications, then above code will fail } |
The toast notification resembles the following image. When it's triggered, it will appear in the top right section of the end-user's screen: